<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
    }

    /* html {
      font-size: 100px;
    } */

    header {
      width: 7.5rem;
      height: 1.28rem;
      background: lightblue;
    }

    .main {
      width: 7.5rem;
      height: 4.5rem;
      background-color: aquamarine;
    }

    .button {
      width: 3.75rem;
      height: 1rem;
      background: lightgreen;
    }
  </style>
</head>
<body>
  <div id="app">
    <header></header>
    <div class="main"></div>

    <div class="button"></div>
  </div>

  <script>
    // 获取用户的手机宽度
    let width = document.documentElement.clientWidth;

    // html的根字体大小
    document.documentElement.style.fontSize = width * 50 / 375 + "px";
  </script>
</body>
</html>